package com.hd.util;

import com.hd.enumerate.ResultCode;

public class ResultCommonUtils {

	public static final int STATUS_CODE_200 = 200;
	public static final int STATUS_CODE_500 = 500;
	private int code;
	private String message;
	private Object data;

	public ResultCommonUtils() {

	}

	public ResultCommonUtils(int code) {
		this.code = code;
	}

	public ResultCommonUtils(int code, String message) {
		this.code = code;
		this.message = message;
	}

	public ResultCommonUtils(int code, Object data, String message) {
		this.code = code;
		this.data = data;
		this.message = message;
	}

	public static ResultCommonUtils getSuccessMessage() {
		return new ResultCommonUtils(STATUS_CODE_200);
	}

	public static ResultCommonUtils getErrorMessage() {
		return new ResultCommonUtils(STATUS_CODE_500);
	}

	public static ResultCommonUtils getResultCommonMessage(ResultCode code, String message) {
		return new ResultCommonUtils(code.getValue(), message);
	}

	public static ResultCommonUtils getResultCommonMessage(ResultCode code, Object data, String message) {
		return new ResultCommonUtils(code.getValue(), data, message);
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

}
